import Router from 'vue-router'
import Main from '@/view/Main'
import Search from '@/view/Search'
import Read from '@/view/Read'
import BookInfo from '@/view/BookInfo'
import BookCatalog from '@/view/BookCatalog'
import SoreMore from '@/view/SoreMore'
import StoreMore from '@/view/StoreMore'

Vue.use(Router);

module.exports = new Router({
    routes: [
        {
            path: '/main',
            name: 'main',
            component: Main
        }, {
            path: '/search',
            name: 'search',
            component: Search,
        },{
            path: '/bookInfo',
            name: 'bookInfo',
            component: BookInfo,
        }, {
            path: '/bookCatalog',
            name: 'bookCatalog',
            component: BookCatalog,
        },
        {
            path: '/read',
            name: 'read',
            component: Read,
        },
        {
            path: '/soreMore',
            name: 'soreMore',
            component: SoreMore,
        },
        {
            path: '/storeMore',
            name: 'storeMore',
            component: StoreMore,
        },
        {
            path: '/',
            redirect: to => {
                return {name: 'main', query:{
                        chapterIndex:0,
                        bookId: '5aa6471d2146ea7a4cb0980c',
                        sourceId: '5acb127fe36bd0e811d26d2b'
                    }}
            }
        },
        { path: '*', redirect: '/' }
    ]
});
